package com.example.messenger;

import java.io.Serializable;

public class Messages implements Serializable {
        private String sender;
        private String reciever;
        private String time;
        private String message;
        private String shortMessage;
        private int id;
        public Messages(String receiver, String name, String time, String message, int id) {
        	super();
            sender = name;
            reciever = receiver;
            this.time = time;
            this.message = message;
            this.id = id;
            shortMessage = message.substring(0,Math.min(message.length(),20));
        }
       public Messages(){
    	   sender = "Default Name";
    	   reciever = "Default reciever";
    	   time = "Default Time";
    	   message = "Default Message";
    	   shortMessage = "msg";
    	   id = -1;
       }
        public String getSender() {
                return sender;
        }
        public void setSender(String name) {
        	sender = name;
        }
        public String getReciever(){
        	return reciever;
        }
        public void setReciever(String name){
        	reciever = name;
        }
        public String getTime() {
                return time;
        }
        public void setTime(String time) {
                this.time = time;
        }
        public String getMessage() {
                return message;
        }
        public void setMessage(String message) {
                this.message = message;
        }
        public String getShortMessage(){
        	return shortMessage;
        }
        public void setShortMessage(String shortMessage){
        	this.shortMessage = shortMessage;
        }
        public int getID(){
        	return id;
        }
        public void setID(int id){
        	this.id = id;
        }
}
